<?php

namespace app\common\model;

use think\Db;
use think\Model;

/**
 * 审批 -- 采购
 */
class approvesPurchase extends Model
{

    // 开启自动写入时间戳字段
    protected $autoWriteTimestamp = 'integer';
    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    // 追加属性
    protected $append = [

    ];

    public function getPartContentAttr($value)
    {

        if (!$value){
            return [];
        }
        $data = json_decode($value,true);
        foreach ($data as &$item){
            $arr = [];
            foreach ($item['images'] as $v){
                $arr[] = cdnurl($v,true);
            }
            $item['images_full'] = $arr;
        }
        return $data;
    }


}
